package com.hifar.demo3;

public class OperationDataProcessor {
    public static Object parseValue(String value, String type) {
        if (type == null) {
            return value;
        }
        
        switch (type.toLowerCase()) {
            case "numeric":
                try {
                    return Double.parseDouble(value);
                } catch (NumberFormatException e) {
                    return value;
                }
            case "checkbox":
                return "是".equals(value) || "合格".equals(value) || "符合".equals(value) || 
                       "true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value);
            case "date":
                // 实现日期解析逻辑
                return value; // 简化处理，实际应解析为Date对象
            default:
                return value;
        }
    }
}